import axios from '@/utils/request'
//类目
//获取类目全部分页
export const getCategoryPage = (data) => {
    return axios({
        url: '/category/getCategoryPage',
        method: 'POST',
        data,
    })
}
//编辑
export const editCategory = (data) => {
    return axios({
        url: '/category/editCategory',
        method: 'POST',
        data,
    })
}
//删除
export const deleteCategory = (id) => {
    return axios({
        url: '/category/deleteCategory',
        method: 'GET',
        params:{
            id
        }
    })
}
//详情
export const getCategoryDetail = (id) => {
    return axios({
        url: '/category/getCategoryDetail',
        method: 'GET',
        params:{
            id
        }
    })
}

//详情
export const getCategoryInfo = (id) => {
    return axios({
        url: '/category/getCategoryInfo',
        method: 'GET',
        params:{
            id
        }
    })
}
//商品
//获取商品全部分页
export const getSpuPage = (data) => {
    return axios({
        url: '/product/getSpuPage',
        method: 'POST',
        data,
    })
}
//获取商品全部分页
export const deleteProduct = (id) => {
    return axios({
        url: '/product/deleteProduct',
        method: 'GET',
        params:{
            id
        }
    })
}
//获取商品属性
export const getSpecList = (id) => {
    return axios({
        url: '/product/getSpecList',
        method: 'GET',
        params:{
            id
        }
    })
}
//获取商品分类
export const getAllCategoryList = (type) => {
    return axios({
        url: '/category/getAllCategoryList',
        method: 'GET',
        params:{
            type
        }
    })
}
//详情
export const getSpuEditDetail = (id) => {
    return axios({
        url: '/product/getSpuEditDetail',
        method: 'GET',
        params:{
            id
        }
    })
}

//品牌属性
//获取品牌列表
export const getBrandList = () => {
    return axios({
        url: '/brand/getBrandList',
    })
}
//获取品牌属性分页
export const getBrandPage = (data) => {
    return axios({
        url: '/brand/getBrandPage',
        method: 'POST',
        data,
    })
}
//编辑品牌属性
export const editBrand = (data) => {
    return axios({
        url: '/brand/editBrand',
        method: 'POST',
        data,
    })
}
//删除品牌属性
export const deleteBrand = (id) => {
    return axios({
        url: '/brand/deleteBrand',
        method: 'GET',
        params:{
            id
        }
    })
}
//品牌属性详情
export const getBrandDetail = (id) => {
    return axios({
        url: '/brand/getBrandDetail',
        method: 'GET',
        params:{
            id
        }
    })
}


//销售属性
//获取销售分页
export const getSpecPage = (data) => {
    return axios({
        url: '/product/getSpecPage',
        method: 'POST',
        data,
    })
}
//编辑
export const editSpec = (data) => {
    return axios({
        url: '/product/editSpec',
        method: 'POST',
        data,
    })
}
//删除
export const deleteSpec = (id) => {
    return axios({
        url: '/product/deleteSpec',
        method: 'GET',
        params:{
            id
        }
    })
}


//单位
//获取单位分页
export const getUnitPage = (data) => {
    return axios({
        url: '/product/getUnitPage',
        method: 'POST',
        data,
    })
}
//编辑单位
export const editUnit = (data) => {
    return axios({
        url: '/product/editUnit',
        method: 'POST',
        data,
    })
}
//删除单位
export const deleteUnit = (id) => {
    return axios({
        url: '/product/deleteUnit',
        method: 'GET',
        params:{
            id
        }
    })
}
//单位
export const getUnitList = () => {
    return axios({
        url: '/product/getUnitList',
        method: 'GET',
    })
}

//运费模板
//获取运费模板分页
export const getFreightPage = (data) => {
    return axios({
        url: '/product/getFreightPage',
        method: 'POST',
        data,
    })
}
//编辑
export const editFreight = (data) => {
    return axios({
        url: '/product/editFreight',
        method: 'POST',
        data,
    })
}
//详情
export const getFreightDetail = (id) => {
    return axios({
        url: '/product/getFreightDetail',
        method: 'GET',
        params:{
            id
        }
    })
}
//详情
export const getFreightList = () => {
    return axios({
        url: '/product/getFreightList',
        method: 'GET',
    })
}
//删除
export const deleteFreight = (id) => {
    return axios({
        url: '/product/deleteFreight',
        method: 'GET',
        params:{
            id
        }
    })
}

//梯度价格
//获取分页
export const getGradientPricePage = (data) => {
    return axios({
        url: '/product/getGradientPricePage',
        method: 'POST',
        data,
    })
}
//编辑
export const editGradientPrice = (data) => {
    return axios({
        url: '/product/editGradientPrice',
        method: 'POST',
        data,
    })
}
//详情
export const getGradientPriceDetail = (id) => {
    return axios({
        url: '/product/getGradientPriceDetail',
        method: 'GET',
        params:{
            id
        }
    })
}
